package com.easyFinder.app.ServiceDAOImpl;

import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class SearchResultsServiceDAOImpl {
    private DataSource dataSource;
    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    public String enterIntoNewEntrytable(Date date, String message) {
        JdbcTemplate jdbcTemplate = new JdbcTemplate();
        List args = new ArrayList();
        String query = "INSERT INTO NEW_ENTRY VALUES ('1',?,?)";
        jdbcTemplate = new JdbcTemplate(dataSource);
        args.add(date);
        args.add(message);
        jdbcTemplate.update(query);
        return null;
    }
}
